//
//  UIButton+Extension.swift
//  HMWeibo1
//
//  Created by liGordon on 16/4/14.
//  Copyright © 2016年 lifuli. All rights reserved.
//

import UIKit

extension UIButton {
    
    
    convenience init(image: String, bkgImage: String = "timeline_card_bottom_background",title: String, fontSize: CGFloat = 12) {
        self.init(frame: CGRectZero)
        
        setBackgroundImage(UIImage(named: bkgImage), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: "\(bkgImage)_highlighted"), forState: UIControlState.Highlighted)
        
        setImage(UIImage(named: image), forState: UIControlState.Normal)
        
        setTitle(title, forState: UIControlState.Normal)
        
        setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
    }
}
